ParcelLabel API

(2 reviews)

Download Label(s)

Resource URL

UAT:

Download all labels generated within a consignment:

https://api.uat.nzpost.co.nz/ParcelLabel/v3/labels/{consignment_id}?format=PDF

Download a label generated within a consignment:

https://api.uat.nzpost.co.nz/ParcelLabel/v3/labels/{consignment_id}?format=PNG&page={page_number}

Production:

Download all labels generated within a consignment:

https://api.nzpost.co.nz/ParcelLabel/v3/labels/{consignment_id}?format=PDF

Download a label generated within a consignment:

https://api.nzpost.co.nz/ParcelLabel/v3/labels/{consignment_id}?format=PNG&page={page_number}

Resource Description

Returns all label images or a specific page image within a consignment. To download all label images within a consignment, set format parameter to "PDF" To download a specific label image within a consignment, set format parameter to "PNG" and set page parameter to the page number of the label. Labels are only available for download of a consignment with status "Complete". Use Get Status of Labels resource to check the status of the consignment prior to download.

Resource Information

AttributeDetail
Response FormatJSON
Requires AuthenticationYes
Rate Limited15 calls per second. If rate limit is exceeded, calls will be queued. Calls unprocessed for over 60 seconds will time out.

Request Parameters

Field NameDescriptionMandExample
consignment_idThe unique id of a consignmentYes7EDZHE
formatThe format of the labels to be downloaded. PDF if download all labels within a consignment. PNG if download a page image within a consignmentYesPDF
pageThe page number if download a labelNo1

Sample Requests

Download all labels generated within a consignment:

https://api.uat.nzpost.co.nz/ParcelLabel/v3/labels/LLT2BL?format=PDF

Download a label generated within a consignment:

https://api.uat.nzpost.co.nz/ParcelLabel/v3/labels/LLT2BL?format=PNG&page=1

Response

The label image is returned.

Field NameDescriptionMandExample
labelpdf or png of label of the requested consignmentYesresponse.pdf

Sample Response

Sample: Failure


{
   "errors": [   {
      "code": "400002",
      "details": "When downloading a label in PNG format, the page requested must be greater than 0.",
      "message": "Invalid parameter(s)"
   }],
   "message_id": "9903db80-381e-11e6-ade7-027b5f7c4691",
   "success": false
}

Reviews